<template>
	<view class="agreement">
		<cu-custom bgColor="bg-gradual-orange" :isBack="true">
			<block slot="content">入驻类型说明</block>
		</cu-custom>
		<view class="agreement-main">
			<view class="agreement-content">
				<view class="agreement-text" v-html="agreement"></view>
			</view>
<!-- 			<view class="agree-choose">
				<checkbox @click="changeStatus" class="uni-checkbox-input" style="margin-right: 15rpx;transform: scale(0.7);"></checkbox >我已详细了解并同意上述所述内容
			</view> -->
		</view>
<!-- 		<view class="takeSure">
			<button class="cu-btn margin-tb-sm lg block"  :disabled='isAbled' :class="[agreeStatus?'bg-red':'block']" @click="takeSure">确定</button>
		</view> -->
	</view>
</template>
<script>
	import shop from '@/api/shop';
	export default {
		data() {
			return {
					agreeStatus:false,
					isAbled:true,
					agreement:'该服务尚未开通',
				}
		},
		onLoad() {
			this.getAreement();
		},
		methods: {
			// changeStatus(){
			// 	this.isAbled = !this.isAbled;
			// 	this.agreeStatus = !this.agreeStatus;
			// },
			// takeSure(){
			// 	if(!this.agreeStatus){
			// 		return false;
			// 	}
			// 	let pages = getCurrentPages();
			// 	if(pages.length<2){
			// 		return false;
			// 	}
			// 	let page = pages[pages.length - 2];
			// 	page.$vm.agreement = true;
			// 	uni.navigateBack({
			// 		delta:1,
			// 	})
			// },
			async getAreement(){
				// let res = shop.getAgreement({
				// 	id:2
				// });
				shop.getAgreement({id:2}).then(res => {
					console.log(res);
					if(res.code==1){
						// this.agreement = res.data;
						this.agreement = res.data.replace(/<img/g,"<img style='max-width:100%!important;height:auto;'");
						
						console.log(this.agreement);
					}else{
						console.log(res);
					}
				});
			}
		}
	}
</script>

<style lang="less">
	.agreement{
		min-height: 100vh;
		background-color: #ffffff;
		position: relative;
		.agreement-main{
			padding: 20rpx;
			font-family: "Source Han Sans CN";
			font-size: 28rpx;
			// color: #333333;
			margin-bottom: 25rpx;
			.agreement-content{
				text-align: left;
				text-indent: 2em;
				padding-bottom: 35rpx;
			}
			.agree-choose{
				color: red;
				text-align: center;
			}
		}
		.takeSure{
			margin: 0 25rpx;
			position: absolute;
			// bottom: 25rpx;
			padding:25rpx;
			width: 700rpx;
			border-radius: 15rpx;
		}
	}
</style>